Data(base) persistence in docker swarm mode 您所在的位置:网站首页 docker swarm mysql Data(base) persistence in docker swarm mode

Data(base) persistence in docker swarm mode

2024-07-11 10:48| 来源: 网络整理| 查看: 265

I have the same issue with swarm mode. I believe you can add a constraint to the service which runs the database task on a specific node. In my case, I have 3 mysql databases configured as 1 master and 2 slaves with a monitor to failover to the most current slave in the event of a failure of the master. Seems I would need to define 3 services with each service having 1 task fixed to a specific node, if I wanted to run in swarm mode.

But, it seems that the swarm scheduler really isn’t designed for deploying databases in high availability mode. It seems to me that the admin should be able to specify mount of a local host directory (local volume) and have the scheduler automatically schedule a 1 task service on the host node that contains the local volume. But, as of now, it seems we need to use node constraints to fix the task to a particular node, as a work around.

For now, I am not using swarm mode because of this issue. Rather, I just configure each node with a set of containers and use proxies for connecting the containers on various nodes to each other. I think the focus of swarm at this point is to run services that don’t use persistent volumes, unless you are willing to use some volume plugin like flocker to access your volumes over a network connection. In my case, I require the local databases to be on local NVMe SSD storage for maximizing the performance of mysql. I hope the Docker team puts some thought into how to enhance swarm mode to support such database clusters in the future. In the mean time, I don’t think swarm mode offers enough benefits over just running persistent databases using fixed containers with monitoring/proxying for failover and high availability.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有